﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsGame1.CoreComponents;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace WindowsGame1.SpriteClasses
{
    class ItemSprite : Sprite
    {
        Rectangle location;

        public ItemSprite(Game game, Texture2D texture, Vector2 position)
            : base((Game1)game, texture)
        {
            spriteBatch = Game1.TileSpriteBatch;
            this.position = new Vector2(
            position.X * TileEngine.TileWidth,
            position.Y * TileEngine.TileHeight);
            location = new Rectangle((int)this.position.X,
            (int)this.position.Y,
            TileEngine.TileWidth,
            TileEngine.TileHeight);
        }

        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend,
            SpriteSortMode.Deferred,
            SaveStateMode.None,
            Game1.Camera.TransformMatrix);
            spriteBatch.Draw(texture,
            location,
            Color.White);
            spriteBatch.End();
        }

        public override void Update(GameTime gameTime)
        {
        }
    }
}